package com.cqs.learning.spring.cloud.config.web;

import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lixw
 * @date created in 21:29 2020/5/2
 */
@RestController
@RefreshScope
@Log4j2
public class TestController {

    @Value(value = "${env}")
    private String env;

    @RequestMapping(value = {"/config"})
    public String config() {
        log.info("变量env:{}", env);
        return env;
    }
}
